<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="shortcut icon" href="../favicon.ico"/>
    <link href="bootstrap.min.css" rel="stylesheet"/>

    <title>OAuth2-Shiro Test</title>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-6">
            <h3 class="text-success">Test from 'code' get 'token' [POST]</h3>

            <form action="../oauth/token" method="post" class="form-horizontal">
                <div class="form-group">
                    <label for="client_id" class="col-sm-2 control-label">client_id</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="client_id" name="client_id" value="test"
                               required="true"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="client_secret" class="col-sm-2 control-label">client_secret</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="client_secret" name="client_secret" value="test"
                               required="true"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="grant_type" class="col-sm-2 control-label">grant_type</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="grant_type" name="grant_type"
                               value="authorization_code"
                               readonly/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="redirect_uri" class="col-sm-2 control-label">redirect_uri</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="redirect_uri" name="redirect_uri"
                               value="http://localhost:7777/spring-oauth-client/authorization_code_callback"
                               required="true"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="code" class="col-sm-2 control-label">code</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="code" name="code"
                               value="" placeholder="The code value"
                               required="true"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">&nbsp;</label>

                    <div class="col-sm-10">
                        <button type="submit" class="btn btn-primary">Test 'code' get 'token'</button>
                    </div>
                </div>
            </form>
        </div>

        <div class="col-md-6">
            <h3 class="text-success">Test grant_type='password' [POST]</h3>

            <form action="../oauth/token" method="post" class="form-horizontal">
                <div class="form-group">
                    <label for="client_id2" class="col-sm-2 control-label">client_id</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="client_id2" name="client_id" value="test"
                               required="true"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="client_secret2" class="col-sm-2 control-label">client_secret</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="client_secret2" name="client_secret" value="test"
                               required="true"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="grant_type2" class="col-sm-2 control-label">grant_type</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="grant_type2" name="grant_type" value="password"
                               readonly/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="scope2" class="col-sm-2 control-label">scope</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="scope2" name="scope"
                               value="read write" required="true"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="username2" class="col-sm-2 control-label">username</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="username2" name="username"
                               value="test" required="true"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="password2" class="col-sm-2 control-label">password</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="password2" name="password"
                               value="test" required="true"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">&nbsp;</label>

                    <div class="col-sm-10">
                        <button type="submit" class="btn btn-success">Test 'password'</button>
                    </div>
                </div>
            </form>
        </div>
    </div>


    <div class="row">
        <div class="col-md-6">
            <h3 class="text-success">Test grant_type='client_credentials' [POST]</h3>

            <form action="../oauth/token" method="post" class="form-horizontal">
                <div class="form-group">
                    <label for="client_id3" class="col-sm-2 control-label">client_id</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="client_id3" name="client_id" value="test"
                               required="true"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="client_secret3" class="col-sm-2 control-label">client_secret</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="client_secret3" name="client_secret" value="test"
                               required="true"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="grant_type3" class="col-sm-2 control-label">grant_type</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="grant_type3" name="grant_type"
                               value="client_credentials"
                               readonly/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="scope3" class="col-sm-2 control-label">scope</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="scope3" name="scope"
                               value="read" required="true"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">&nbsp;</label>

                    <div class="col-sm-10">
                        <button type="submit" class="btn btn-info">Test 'client_credentials'</button>
                    </div>
                </div>
            </form>
        </div>

        <div class="col-md-6">
            <h3 class="text-success">Test grant_type='refresh_token' [POST]</h3>

            <form action="../oauth/token" method="post" class="form-horizontal">
                <div class="form-group">
                    <label for="client_id4" class="col-sm-2 control-label">client_id</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="client_id4" name="client_id" value="test"
                               required="true"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="client_secret4" class="col-sm-2 control-label">client_secret</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="client_secret4" name="client_secret" value="test"
                               required="true"/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="grant_type4" class="col-sm-2 control-label">grant_type</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="grant_type4" name="grant_type"
                               value="refresh_token"
                               readonly/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="refresh_token" class="col-sm-2 control-label">refresh_token</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="refresh_token" name="refresh_token"
                               value="b36f4978a1724aa8af8960f58abe3ba1" required="true"/>

                        <p class="help-block">请输入 refresh_token 值</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">&nbsp;</label>

                    <div class="col-sm-10">
                        <button type="submit" class="btn btn-warning">Test 'refresh_token'</button>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <p class="text-center"><a href="javascript:history.back();">返回</a></p>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <hr/>
            <div class="text-center">
                &copy; <a href="http://git.oschina.net/mkk/oauth2-shiro" target="_blank">oauth2-shiro</a>
            </div>
        </div>
    </div>
</div>
</body>
</html>